<template>
    <div>
        我的
        <van-button plain type="primary" @click="toLogin">退出</van-button>
    </div>
</template>

<script setup>
import { useRouter } from 'vue-router';


const router = useRouter()

const toLogin = () =>{
    // 删除本地存储的用户名username
    localStorage.removeItem('username')

    router.push({
        path: '/login'
    })
}
</script>